"""
    create by IAmFiveHigh on 2023/9/7
"""
from typing import List

from list_node import ListNode
from solution import Solution

sample1 = [1, 2, 6, 3, 4, 5, 6]
val1 = 6
sample2 = [7, 7, 7]
val2 = 7
sample3 = []


def t(l: List[int], val: int, fun):
    head = ListNode.init_with_list(l)
    print(f"before: {head}")
    result = fun(head, val)
    print(f"after: {result}")


if __name__ == '__main__':
    print("-" * 10, "cycle", "-" * 10)
    t(sample1, val1, Solution.remove_elements)
    t(sample2, val2, Solution.remove_elements)
    t(sample3, val2, Solution.remove_elements)
    print("-" * 10, "recursion", "-" * 10)
    t(sample1, val1, Solution.remove_elements_by_recursion)
    t(sample2, val2, Solution.remove_elements_by_recursion)
    t(sample3, val2, Solution.remove_elements_by_recursion)
